﻿/**********************************天使物流*******************************************
* 功能描述:结算管理-新增应付费用
* 作者:石锦涛
* 时间:2022-01-10
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.SettleAccounts.NewExpensesPayabs;
using Volo.Abp.Application.Services;

namespace TianShiProject.SettleAccounts.NewExpensesPayabs
{
    public class NewExpenApp:ApplicationService
    {
        private readonly INewExpensesAppRepository _newExpensesAppRepository;

        public NewExpenApp(INewExpensesAppRepository newExpensesAppRepository)
        {
            _newExpensesAppRepository = newExpensesAppRepository;
        }


        /// <summary>
        /// 显示应付费用
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<NewExpensesPayabDto>> GetNewExpenses(string unit, string account, int? state, string handle, string times, int pageindex = 1, int pagesize = 5)
        {
            try
            {
                return await _newExpensesAppRepository.GetNewExpenses(unit, account, state, handle, times, pageindex, pagesize);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task<PageResponse<NewExpensesPayabDto>> DeleteNewExpenses(int Id)
        {
            try
            {
                return await _newExpensesAppRepository.DeleteNewExpenses(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 应付费用修改
        /// </summary>
        /// <param name="newExpenses"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> UpdateNewExpenses(NewExpensesPayabDto newExpenses)
        {
            try
            {
                return await _newExpensesAppRepository.UpdateNewExpenses(newExpenses);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 添加应付费用
        /// </summary>
        /// <param name="newExpenses"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> PostNewExpenses(NewExpensesPayabDto newExpenses)
        {
            try
            {
                return await _newExpensesAppRepository.PostNewExpenses(newExpenses);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量逻辑删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task<PageResponse<NewExpensesPayabDto>> DeleteNewExpensesMser(string Id)
        {
            try
            {
                return await _newExpensesAppRepository.DeleteNewExpensesMser(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }


    }
}
